import { Button, Space } from "antd"
import { useState } from "react"

const ConditionDemo = () => {
  const [state, setState] = useState(false)
  return (
    <>
      <h3>--条件渲染</h3>
      <Space>
        <Button onClick={() => setState(!state)}>条件渲染: {String(state)}</Button>
        {
          state ? null : <Button danger>三目运算符</Button>
        }
        {
          state && <Button type="primary">&&运算符</Button>
        }
      </Space>
    </>
  )
}

export default ConditionDemo
